#include<iostream>
#include<unistd.h>
#include<pthread.h>
//---线程创建----

void* ThreadStart(void* args)
{
    while(true)
    {
        std::cout<<"new thread running..."<<std::endl;
        sleep(1);
    }
}
int main()
{
    pthread_t tid;
    pthread_create(&tid,nullptr,ThreadStart,(void*)"new thread");
    while(true)
    {
        sleep(1);
        std::cout<<"main thread running..."<<std::endl;
    }
    return 0;
}